//
//  NUpDateInfoViewController.m
//  News
//
//  Created by zhangtao on 2018/10/15.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "NUpDateInfoViewController.h"

@interface NUpDateInfoViewController ()

@end

@implementation NUpDateInfoViewController
{
    UITextField *tf;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = MAIN_BG_COLOR;
    UILabel *lab = [[UILabel alloc]initWithFrame:CGRectMake(0, navHeight, ACEWidth, 45)];
    lab.backgroundColor = MAIN_BG_COLOR;
    lab.font = MIN_FONT;
    lab.text = @"  长度为xxxxxx";
    [self.view addSubview:lab];
    
    UIView *tfV = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(lab.frame), ACEWidth, 45)];
    tfV.backgroundColor = [UIColor whiteColor];
    
    tf = [[UITextField alloc]initWithFrame:CGRectMake(10, 0, ACEWidth-20, 45)];
    tf.font = BASE_FONT;
    tf.backgroundColor = [UIColor whiteColor];
    [tfV addSubview:tf];
    [self.view addSubview:tfV];
    
    UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(tfV.frame)+15, ACEWidth-30, 45)];
    [btn setBackgroundColor:MAIN_COLOR];
    btn.layer.cornerRadius = 3;
    [btn setTitle:@"保存" forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    
    

}

-(void)click{
    if (tf.text.length>0) {
        self.cell.detailTextLabel.text = tf.text;
    }
    [self.navigationController popViewControllerAnimated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
